/*
 * DbConfigView.java
 *
 * Created on 23 Eylül 2008 Salı, 15:06
 */
package org.testis.gui.mvc.view.testdesign;

import org.testis.gui.mvc.view.*;
import org.testis.gui.mvc.controller.TestDesignControllerList;
import org.testis.gui.mvc.controller.testdesign.SelectSuiteController;
import org.testis.gui.mvc.utilities.CheckListItem;
import org.testis.gui.mvc.utilities.CheckListRenderer;
import org.testis.gui.mvc.utilities.Validatable;
import java.awt.Frame;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeEvent;
import java.util.LinkedList;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.ListSelectionModel;

/**
 *
 * @author  nurhat
 */
public class LabelFilterView extends javax.swing.JDialog implements
        AbstractViewPanel,
        Validatable {

    private static final long serialVersionUID = 203213L;

    /** Creates new form DbConfigView */
    public LabelFilterView(java.awt.Frame parent,
            boolean modal) {
        super(parent,
                modal);
        initComponents();
    }

    public LabelFilterView(Frame parent,
            boolean modal,
            boolean editMode) {
        super(parent, modal);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btnClose = new javax.swing.JButton();
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jScrollPane2 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Select Tree Load");
        setLocationByPlatform(true);
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        btnClose.setText("Close");
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jSplitPane1.setLeftComponent(jScrollPane1);

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane2.setViewportView(jList1);

        jSplitPane1.setRightComponent(jScrollPane2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE)
                    .addComponent(btnClose))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 417, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnClose)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
    this.setVisible(false);
    this.setEnabled(false);
    this.dispose();
}//GEN-LAST:event_btnCloseActionPerformed

private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
//    WindowListener[] listeners = getWindowListeners();
//    for (int i = 0; i < listeners.length; i++) {
//        this.removeWindowListener(listeners[i]);
//    }
//    TestDesignControllerList.newInstance().getDbConfigController().
//            operationClose();
}//GEN-LAST:event_formWindowClosed

    @Override
    public void modelPropertyChange(PropertyChangeEvent evt) {
        /*
        if (evt.getPropertyName().equals(SelectSuiteController.VIEWVISIBILITY_PROPERTY)) {
            setVisible(true);
        } else if (evt.getPropertyName().equals(SelectSuiteController.LAST_LOADED_TESTSUITES_PROPERTY)) {
            LinkedList<String> newValue = (LinkedList<String>) evt.getNewValue();
            loadTestSuiteList(newValue);
        } else if (evt.getPropertyName().equals(SelectSuiteController.LAST_LOADED_DYNAMICMAPS_PROPERTY)) {
            LinkedList<String> newValue = (LinkedList<String>) evt.getNewValue();
            loadDynamicMapList(newValue);
        }
         */
    }

    @Override
    public boolean validateForm() {
        boolean valid = true;
        return valid;
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnClose;
    private javax.swing.JList jList1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
   

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                TestDesignControllerList.newInstance().getSelectSuiteController().startLoader();
            }
        });
    }
}
